function checkPermutation(s1, s2) {
    if (s1.length!== s2.length) {
        return false;
    }
    const map = new Map();
    for (let i = 0; i < s1.length; i++) {
        map.set(s1[i],map.has(s1[i])?map.get(s1[i]) + 1:1)
        map.set(s2[i],map.has(s2[i])?map.get(s2[i]) - 1:-1)
    }
    for (const [key, val] of map) {
        if (val!== 0) {
            return false;
        }
    }
    return true;
}